<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('牛奶出库列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div>
            <div>
                <form id="formId">
                    <!--  <div class="select-list">-->
                    <input hidden="hidden"  name="orderId" th:value="${orderId}"/>
                    <!--  </div>-->
                </form>
            </div>

        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <h3>入库单号：&nbsp;&nbsp;<span th:text="${orderCode}"></span>&nbsp;&nbsp;入库时间:&nbsp;&nbsp;<span  th:text="${orderTime}"></span>&nbsp;&nbsp;入库经手人:&nbsp;&nbsp;<span th:text="${createBy}"></span></h3>
            <!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:ncInputChicken:add">
               <i class="fa fa-plus"></i> 新增
           </a>
           <a class="btn btn-warning" onclick="confirmTable();">
               <i class="fa fa-send"></i> 单据确认
           </a>
           <a class="btn btn-primary " onclick="openOrder();">
               <i class="fa fa-table"></i> 入库单管理
           </a>
           &lt;!&ndash;<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:ncInputChicken:edit">
               <i class="fa fa-edit"></i> 修改
           </a>
           <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:ncInputChicken:remove">
               <i class="fa fa-remove"></i> 删除
           </a>
           <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ncInputChicken:export">
                   <i class="fa fa-download"></i> 导出
            </a>&ndash;&gt;-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>

    </div>
    <div class="bottom-btns"></div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    // var editFlag = [[${@permission.hasPermi('system:ncInputChicken:edit')}]];
    // var removeFlag = [[${@permission.hasPermi('system:ncInputChicken:remove')}]];
    var prefix = "/system/ncCowsMilk";
    var datas = [[${@dict.getType('outputType')}]];

    $(function() {
        var options = {
            url: prefix + "/frontOrdeListInfo?orderId="+[[${orderId}]],
            // createUrl: prefix + "/add",
            // updateUrl: prefix + "/edit/{id}",
            // removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "牛奶入库",
            showExport: false,
            showSearch: false,
            showRefresh: false,
            showColumns: false,
            showToggle: false,
            columns: [{
                checkbox: true
            },
                {
                    field : 'outputId',
                    title : '出库id',
                    visible: false
                },
                {
                    field : 'milkCode',
                    title : '牛奶批次',
                    sortable: true
                },
                {
                    field : 'cropName',
                    title : '产品名称',
                    sortable: true
                },
                {
                    field : 'cfAmounts',
                    title : '需求数量（kg）',
                    sortable: true
                },
                {
                    field : 'outputAmout',
                    title : '实际提供数量（kg）',
                    sortable: true
                },
                {
                    field : 'disinfector',
                    title : '牛奶消毒人',
                    sortable: true
                },
                {
                    field : 'milkman',
                    title : '挤奶员',
                    sortable: true
                },
                {
                    field: 'outputType',
                    title: '出库类型',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field : 'outputTime',
                    title : '出库时间',
                    sortable: true
                },
                {
                    field : 'outputUser',
                    title : '出库经手人',
                    sortable: true
                },
                /* {
                     field : 'createBy',
                     title : '创建者',
                     sortable: true
                 },
                 {
                     field : 'createTime',
                     title : '创建时间',
                     sortable: true
                 },*/
                {
                    field : 'remark',
                    title : '备注',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value);
                    }
                }
                // ,
                // {
                //     title: '操作',
                //     align: 'center',
                //     formatter: function(value, row, index) {
                //         var actions = [];
                //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.inputId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.inputId + '\')"><i class="fa fa-remove"></i>删除</a>');
                //         return actions.join('');
                //     }
                // }
                ]
        };
        $.table.init(options);
    });

    /*打开检测记录单*/
    function openOrder() {

        var url = ctx + 'system/ncOrder?orderType=12 ';

        $.modal.openTab("检测记录单", url);
    }
    function reload() {
        window.location.reload()
    }
</script>
</body>
</html>